package com.thinkfit.jy.utils;

import android.widget.ImageView;

import com.common.lib.manager.DataManager;
import com.thinkfit.jy.R;

public class SoundIconUtils {

    static SoundIconUtils soundIconUtils;

    public static SoundIconUtils getInstance(){
        if(soundIconUtils == null){
            soundIconUtils = new SoundIconUtils();
        }
        return soundIconUtils;
    }

    public void setVolume(ImageView iv, int volume){
        if(volume<=0){
            iv.setImageResource(getMinIcon(DataManager.Companion.getInstance().getMainStyle()));
//            iv.setImageResource(R.drawable.img_main_volume_min_dw);
//            ivVolume.setImageResource(R.drawable.img_main_volume_min);
        }else if(volume<10){
            iv.setImageResource(getMidIcon(DataManager.Companion.getInstance().getMainStyle()));
//            iv.setImageResource(R.drawable.img_main_volume_mid_dw);
//            ivVolume.setImageResource(R.drawable.img_main_volume_mid);
        }else if(volume<15){
            iv.setImageResource(getMaxIcon(DataManager.Companion.getInstance().getMainStyle()));
//            iv.setImageResource(R.drawable.img_main_volume_max_dw);
//            ivVolume.setImageResource(R.drawable.img_main_volume_max);
        }
    }

    public int getMinIcon(int type){
        switch (type){
            case ThemeUtils.THEME_DRAGON_BOAT_FESTIVAL:
                return R.drawable.img_main_volume_min_dw;
            case ThemeUtils.THEME_FIRE_PROTECTION:
                return R.drawable.img_main_volume_min_xf;
            case ThemeUtils.THEME_PINK:
                return R.drawable.img_main_volume_min_pink;
            case ThemeUtils.THEME_LANDSCAPE:
                return R.drawable.img_main_volume_min_scenery;
            default:
                return R.drawable.img_main_volume_min;
        }
    }
    public int getMidIcon(int type){
        switch (type){
            case ThemeUtils.THEME_DRAGON_BOAT_FESTIVAL:
                return R.drawable.img_main_volume_mid_dw;
            case ThemeUtils.THEME_FIRE_PROTECTION:
                return R.drawable.img_main_volume_mid_xf;
            case ThemeUtils.THEME_PINK:
                return R.drawable.img_main_volume_mid_pink;
            case ThemeUtils.THEME_LANDSCAPE:
                return R.drawable.img_main_volume_mid_scenery;
            default:
                return R.drawable.img_main_volume_mid;
        }
    }
    public int getMaxIcon(int type){
        switch (type){
            case ThemeUtils.THEME_DRAGON_BOAT_FESTIVAL:
                return R.drawable.img_main_volume_max_dw;
            case ThemeUtils.THEME_FIRE_PROTECTION:
                return R.drawable.img_main_volume_max_xf;
            case ThemeUtils.THEME_PINK:
                return R.drawable.img_main_volume_max_pink;
            case ThemeUtils.THEME_LANDSCAPE:
                return R.drawable.img_main_volume_max_scenery;
            default:
                return R.drawable.img_main_volume_max;
        }
    }

}
